<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文字hover时渐变色使用</title>
  <style>
    .record span {
      background-image: linear-gradient(to right, #cbee62, #16d52f, #1c95c8, #087fb3);
      background-repeat: no-repeat;
      background-size: 0 2px;
    }
    .record span:hover {
      transition: background-size 1s ease-in-out;
      background-size: 100% 2px;
      background-position: left bottom;
    }
  </style>
</head>
<body>
  <div class="record">
    <span>有趣且重要的css知识合集（2）linear-gradient的应用</span>
  </div>
</body>
</html>